import { Component, OnInit } from '@angular/core';

import { fadeIn, groupFlyInOut } from '../animation/complex.animation';

@Component({
  selector: 'app-complex',
  templateUrl: './complex.component.html',
  styleUrls: ['./complex.component.scss'],
  animations: [
    fadeIn,
    groupFlyInOut,
  ]
})
export class ComplexComponent implements OnInit {

  images = []

  constructor() { }

  ngOnInit() {
  }

  add(){
    this.images.push(...Array.from({length: 5},(v,i) => v = { src: `https://via.placeholder.com/100x100?text=${i+1}`}));
  }

  del(index){
    this.images.splice(index,1);
  }

  remove(){
    this.images.splice(0,this.images.length);
  }

}
